﻿@using MovieDB.Models;
@using System.Linq;

@model PagedMovieModel

@section Scripts {
 <script src="@Url.Content("~/Scripts/Views/Home/MovieList.js")" type="text/javascript"></script>
}


@{
    ViewBag.Title = "Welcome to RRs MovieDB";
}

@Html.Partial("_MovieList",Model.Movies)

@section Footer{
     @MvcHtmlString.Create(@Html.Pager(Model.NextPageBaseUrl, Model.Page, Model.PageSize, Model.TotalAmountOfMovies))
}

@{
    if (TempData["Autocomplete"] != null)
    {
        <div>
            <a href="#" onclick="history.back(); return false;">Back to List</a>
        </div>
    }
    else
    {
        <div class="movieCount">Database contains @Model.TotalAmountOfMovies movies.</div>
    }        
}